<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container{
            width: 300px;
            height: 400px;
            display: grid;
            /* 设置列宽和行高 */
            grid-template-columns: 100px 100px 100px;
            grid-template-rows: 100px 100px 100px 100px;
            /* 进行位置排布 */
            grid-template-areas: 
                  "header header header"
                  "sidebar content content"
                  "sidebar content content"
                  "footer footer footer"
        }
        /* 给子元素起名字 */
        header{
            grid-area: header;
            font-size: 5rem;
            background: aqua;
        }
        sidebar{
            grid-area: sidebar;
            font-size: 2.5rem;
            background: black;
        }
        content{
            grid-area: content;
            font-size: 2.5rem;
            background: cadetblue;
        }
        footer{
            grid-area: footer;
            font-size: 5rem;
            background: darkblue;
        }
    </style>
</head>
<body>
    <div class="container">
        <header>header</header>
        <sidebar>sidebar</sidebar>
        <content>content</content>
        <footer>footer</footer>
    </div>
</body>
</html>